Skip to content

Adds content-filtering to the Subscription class#898

Closed
wayneparrott wants to merge 4 commits intoRobotWebTools:developfrom
wayneparrott:subscription_content_filter
Closed

Adds content-filtering to the Subscription class#898
wayneparrott wants to merge 4 commits intoRobotWebTools:developfrom
wayneparrott:subscription_content_filter

Conversation

@wayneparrott
Copy link
Contributor

ROS Humble introduced the content-filtering topics feature. This PR
makes makes this feature available to rclnodejs developers.

Resources
DDS 1.4 specification, Annex B
Content-filtering tutorial
ros2/design#282

Supported RMWs
Content-filtering is supported by the following RMWs as of the Humble release:

  • rmw_fastrtps - default Humble RMW
  • rmw_connext
  • rmw_gurumdds_cpp

rmw_cyclonedds_cpp does NOT support content-filtering yet.

Key Changes
node.js

  • added contentFilter object to Options, {expression: string, parameters?: Array}
  • added static getDefaultOptions()
  • updated createSubscription() to support contentFilter

node.d.ts

  • added content-filter types

rcl_bindings.cpp

  • added content-filtering to CreateSubscription()

rmw.js

  • new class for identifying the current ROS middleware

test-subscription-content-filter.js

  • test cases for content-filters

examples

  • publisher-content-filtering-example.js
  • subscription-content-filtering-example.js

package.json

  • added build/rebuild scripts for developer convenience

wayneparrott and others added 4 commits February 25, 2023 20:57
makes makes this feature available to rclnodejs developers.

node.js
- added contentFilter to Options
- added static getDefaultOptions()
- updated createSubscription() to support contentFilter

node.d.ts
- added content-filter types

rcl_bindings.cpp
- added content-filtering to CreateSubscription()

rmw.js
- new class for identifying the current ROS middleware

test-subscription-content-filter.js
- test cases for content-filters

examples:
- publisher-content-filtering-example.js
- subscription-content-filtering-example.js

package.json
- added build/rebuild scripts for convenience
On windows workflow use node 18.12.0 inplace of 18.13.0. There is a
repeatable issue with node-gyp configuration on node 18.13. It seems to
be related to the node cache. Switching to 18.12 avoids using a cached
version of node 18 and the issue no longer occurs.

Fix RobotWebTools#890
@wayneparrott
Copy link
Contributor Author

I discovered that I omitted an additional api for resetting a subscription content-filter. Please hold off reviewing. I will reopen this PR once I've implemented that feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants